<template>
	<view>
		<button @click="">console.debug</button>
		<button @click="callSetStorage()">获取缓存</button>
		<button @click="callStoInFo()" type="primary">获取列表字段</button>
		<button @click="callRemove()" type="warn" plain="true">删除</button>
		<button @click="callClear()" type="warn">清空</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			callSetStorage(){
				uni.setStorage({
					key:"userName",
					data:"wzy",
					success(){
						console.log("存储userNmae 成功调回");
					},
					fail(){
						console.error("存储userNmae 失败");
					}
				})
			},
			callSetStorage(){
				uni.getStorage({
					key:"userName",
					success:function(result){
						console.log("获取本地缓存成功:"+ result);
					},
					fail:function(e){
						console.error("获取本地缓存失败:"+ JSON.stringify(result));
						console.error("获取本地缓存失败:"+ result.errMsg);
					}
				})
			},
			callStoInFo(){
				console.log("callStoInfo-->");
				uni.getStorageInfo({
					success:function(result){
						console.log("callStoInfo-->"+JSON.stringify(result));
						consolelog("callStoInfo-->"+result.keys);
					}
				})
			},
			callRemove(){
				uni.removeStorage({
					key:"xingming",
					success:()=>{
						console.log("removeStorage su")
					}
				})
			}
		}
	}
</script>

<style>

</style>
